package com.woniuxy01;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

class Animal {

}

class Dog extends Animal {

}

class Cat extends Animal {

}

public class Test02 {
    public static void main(String[] args) {
        List<?> list1= new ArrayList<Object>();
        List<?> list2= new ArrayList<Animal>();
        List<?> list3= new ArrayList<Dog>();
        List<?> list4= new ArrayList<Cat>();

//        List<? extends Animal> list5= new ArrayList<Object>();
        List<? extends Animal> list6= new ArrayList<Animal>();
        List<? extends Animal> list7= new ArrayList<Cat>();
        List<? extends Animal> list8= new ArrayList<Dog>();

        List<? super Animal> list9= new ArrayList<Object>();
        List<? super Animal> list10= new ArrayList<Animal>();
//        List<? super Animal> list11= new ArrayList<Dog>();
//        List<? super Animal> list12= new ArrayList<Cat>();
    }

    private static void test01() {
        ArrayList<Object> objects = new ArrayList<>();
        objects.add(new Dog());
        objects.add(new Object());
        objects.add(new Animal());

        List<?> list1=objects;
    }
}
